package options

import (
	"context"
	"github.com/gogf/gf/v2/frame/g"
	"goAdminV1/api/options/v1"
	"goAdminV1/utility"
)

func (c *ControllerV1) DataRang(ctx context.Context, req *v1.DataRangReq) (res *v1.DataRangRes, err error) {
	data := []map[string]interface{}{
		{"label": "全部数据", "value": 1},
		{"label": "自定义数据", "value": 2},
		{"label": "本人数据", "value": 3},
		{"label": "部门数据", "value": 4},
		{"label": "部门及以下数据", "value": 5},
	}

	// 直接设置响应，配合前端所需数据格式
	g.RequestFromCtx(ctx).Response.WriteJson(utility.Success(data))
	return nil, nil
}
